package com.example.framework;

public class ContactHelper extends HelpersBase {

	public ContactHelper(ApplicationManager applicationManager) {
		super(applicationManager);
	}

	public void createContact(Contact contact) {
		initContactCreation();
		fillContactForm(contact);
		confirmContactCreation();
	}

	public void initContactCreation() {
		manager.getAutoItHelper()
				.winWaitAndActivate("AddressBook Portable", "", 5000)
				.click("Add").winWaitAndActivate("Add Contact", "", 5000);
	}
	
	public void fillContactForm(Contact contact) {
		manager.getAutoItHelper().send("", contact.firstName)
				.send("", contact.lastName);
	}

	public void confirmContactCreation() {
		manager.getAutoItHelper().click("Save")
				.winWaitAndActivate("AddressBook Portable", "", 5000);
	}



}
